package zjy;

public class YZT {
    private double radius;
    private double height;

    public YZT(double radius, double height) {
        this.radius = radius;
        this.height = height;
    }

    public YZT() {
        this.radius = 1.0;
        this.height = 1.0;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
    public double calTJ(){
        double s=Math.PI*this.radius*this.radius;
        double v=s* this.height;
        return v;
    }
    public double calBMJ(){
        double c=Math.PI*2*this.radius;
        double s=Math.PI*this.radius*this.radius;
        double sum=2*s+c* this.height;
        return sum;
    }
    public void judge() {
        if(radius<0||height<0){
            System.out.println("不合理");
        }
        else{
            System.out.println("合理");
        }
    }
}
